class Solution {
public:
    bool judgeSquareSum(int c) {
        int a;
        double b;
        for (a = 0; (long long)a*a <= c; ++a) {
            b = sqrt(c-a*a);
            if (b == (int) b) {
                return true;
            }
        }
        return false;
    }
};